#include "interpreter.cpp"
#include "utils.h"

int main()
{
    Frame *global = new Frame;
    Frame* child = new Frame(global);
    Frame* child2 = new Frame(child);
    string temp;
    global->def(string("x"), new Var("2"));
    global->def("a", new Var("1"));
    global->def("d", new Var("2"));
    while (getline(cin, temp))
    {
        try
        {
            /*auto a = cutAll(temp,global);
            for(auto i:a){
                cout << i << endl;
            }*/
            cout << balance(temp) << endl;
            /*auto ss= findEye(temp);
        for(auto i:ss){
            cout << i << " ";
        }
        cout << endl;
        singleThreeEye(temp,ss[0],ss[1],ss[2],ss[3],global);
        cout << temp << endl;*/
        }
        catch (char const *msg)
        {
            cerr << msg << endl;
            continue;
        }
        catch (string const msg)
        {
            cerr << msg << endl;
            continue;
        }
    }
}